<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <link rel="stylesheet" type="text/css" href="/static/css/reset.css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/login.css"/>
</head>

<body>
<!--header start-->
<div class="header">
    <div class="container">
        <img src="/static/images/login.png"/>
        <span></span>
        <div>CES管理后台</div>
    </div>
</div>
<!--header end-->

<div class="content">
    <div class="login">
        <div class="login-header">账户登录</div>
        <div class="login-container">
            <input type="text" name="mobile" id="mobile" placeholder="输入手机号" />
            <input type="password" name="password" id="password" placeholder="输入密码" />
            <a id="login" href="javascript:void(0);">登录</a>
        </div>
    </div>
</div>

<!--js-->
<script src="/static/libs/jquery/jquery.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/libs/bootstrap/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>

<script type="text/javascript">
    $(document).ready(function(){
        $("#login").on("click", function(){
            console.log("login begin");
            $.ajax({
                url: "/manage/login",
                type: "POST",
                data: {
                    mobile: $("#mobile").val(),
                    password: $("#password").val()
                },
                success: function (data) {
                    if (data.status) {
                        window.location.href=data.data;
                    } else {
                        alert(data.message);
                    }
                }
            });
        });
    });
</script>

</body>
</html>
